package com.tfswx.fljdmxyy.query.rwrz;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 列表任务日志的输入参数
 *
 * @author: 陈文佳
 * @date: 2022-10-24
 **/
@ApiModel(value = "RwrzQueryParam", description = "列表任务日志的输入参数")
@Data
public class RwrzQueryParam {

    @ApiModelProperty(value = "任务名称;定时任务01", example = "")
    private String rwmc;

    @ApiModelProperty(value = "是否成功", example = "Y/N")
    private String sfcg;

    @ApiModelProperty(value = "起始时间", example = "")
    private Date kssj;

    @ApiModelProperty(value = "结束时间", example = "")
    private Date jssj;


    public void setKssj(Date kssj) {
        if (ObjectUtil.isNotEmpty(kssj)) {
            this.kssj = DateUtil.beginOfDay(kssj);
        }
    }

    public void setJssj(Date jssj) {
        if (ObjectUtil.isNotEmpty(jssj)) {
            this.jssj = DateUtil.beginOfDay(DateUtil.offsetDay(jssj, 1));
        }
    }
}